<?php

namespace Ue\ErpBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ProductItem
 *
 * @ORM\Table(name="ue_product_item", indexes={@ORM\Index(name="parent_id_idx", columns={"parent_id"}), @ORM\Index(name="product_id_idx", columns={"product_id"})})
 * @ORM\Entity
 */
class ProductItem
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="qty", type="integer", nullable=true)
     */
    private $qty = '1';

    /**
     * @var \Product
     *
     * @ORM\ManyToOne(targetEntity="Product")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
     * })
     */
    private $parent;

    /**
     * @var \Product
     *
     * @ORM\ManyToOne(targetEntity="Product")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="product_id", referencedColumnName="id")
     * })
     */
    private $product;



    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set qty
     *
     * @param integer $qty
     * @return ProductItem
     */
    public function setQty($qty)
    {
        $this->qty = $qty;

        return $this;
    }

    /**
     * Get qty
     *
     * @return integer 
     */
    public function getQty()
    {
        return $this->qty;
    }

    /**
     * Set parent
     *
     * @param \Ue\ErpBundle\Entity\Product $parent
     * @return ProductItem
     */
    public function setParent(\Ue\ErpBundle\Entity\Product $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get parent
     *
     * @return \Ue\ErpBundle\Entity\Product 
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Set product
     *
     * @param \Ue\ErpBundle\Entity\Product $product
     * @return ProductItem
     */
    public function setProduct(\Ue\ErpBundle\Entity\Product $product = null)
    {
        $this->product = $product;

        return $this;
    }

    /**
     * Get product
     *
     * @return \Ue\ErpBundle\Entity\Product 
     */
    public function getProduct()
    {
        return $this->product;
    }
}
